package com.example.rjb_shoping.controller;

import com.example.rjb_shoping.entity.RjbRule;
import com.example.rjb_shoping.service.RjbRuleService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (RjbRule)表控制层
 *
 * @author makejava
 * @since 2021-06-09 20:43:19
 */
@RestController
@RequestMapping("rjbRule")
public class RjbRuleController {
    /**
     * 服务对象
     */
    @Resource
    private RjbRuleService rjbRuleService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public RjbRule selectOne(Integer id) {
        return this.rjbRuleService.queryById(id);
    }

    /**
     * 查询所有
     * @return
     */
    @GetMapping("selectAll")
    public List<RjbRule> selectAll(){
        return rjbRuleService.queryAllList();
    }
}
